﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Arrays
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("掌声热烈欢迎练习语句块表演家们上台表演");
            // 一维数组
            Console.WriteLine("大家好,我们是数组表演团的");
            int[] arr1 = new int[8];
            for( int i = 0; i < arr1.Length; i++)
            {
                Console.WriteLine(arr1[i]);
            }
            
            int[] arr2 = new int[5] { 1, 2, 3, 4, 5 };
            for(int i = 0; i < arr2.Length; i++)
            {
                Console.WriteLine(arr1[i]);
            }

            int[] arr3 = new int[]{ 1, 0, 0, 8 };
            for (int i = 0; i < arr3.Length; i++)
            {
                Console.WriteLine(arr2[i]);
            }

            //Arrays
            int[,] arr = { { 13, 14, 525 }, { 10, 24, 01 }, { 20, 48, 0 } };
            for(int i = 0; i<arr.Length; i++)
            {
                for(int j = 0; j < arr.Length; j++)
                {
                    Console.Write(i + " , " + j);
                }
                Console.WriteLine();
            }
            //foreach用法
            Console.WriteLine("数组登场");
            foreach(int i in arr)
            {
                Console.WriteLine(i);
            }
            //split用法
            Console.WriteLine("split登场");
            string str = "花有重开日，人无再少年";
            var a = str.Split(',');
            for(int i =0; i < a.Length; i++)
            {
                Console.WriteLine(a[i]);
            }

        }
    }
}
